#pragma once

#include <XAudio2.h>

class SoundManager
{
	// Singleton
	SoundManager();
	virtual ~SoundManager();


	// XAudio Core Components
	IXAudio2				*pAudioEngine;
	IXAudio2SourceVoice		*pSourceVoice;
	IXAudio2MasteringVoice	*pMasterVoice;

	//	Submix for SFX to change all volumes at once
	IXAudio2SubmixVoice*	pSFXSubmixVoice;
	IXAudio2SubmixVoice*	pMusicSubmixVoice;

	// Content
	WAVEFORMATEX waveFormat;
	XAUDIO2_BUFFER m_xa;
	BYTE* m_waveData;

public:
	static SoundManager* getInstance();

	void Initialize();
	void Shutdown();

	// Load a sound
	bool SoundManager::load(const char* szFile);
	void Play();
};